package org.budo.support.spring.resource.loader;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.core.io.DefaultResourceLoader;
import org.springframework.core.io.Resource;

/**
 * @author limingwei
 */
public class BudoSpringResourceLoader extends DefaultResourceLoader {
    private static final Logger log = LoggerFactory.getLogger(BudoSpringResourceLoader.class);

    @Override
    public Resource getResource(String location) {
        Resource resource = super.getResource(location);
        if (null != resource && resource.exists()) {
            return resource;
        }

        log.info("#21 resource=" + resource);
        return resource;
    }
}